package graphics.effects;
import tools.Point;
import graphics.objects.GLight;
import graphics.objects.GraphicsObject;
import graphics.system.Color;
public class GEffect extends GLight {
	public long duration;
	public long starttime;
	public GEffect(Point pos, float radius, long duration, boolean hasLight) {
		super(pos, radius, Color.white);
		this.iseffect = true;
		this.duration = duration;
		this.islight = hasLight;
		starttime = System.currentTimeMillis();
	}
	public GEffect(Point pos, long duration) {
		this(pos, 0, duration, false);
	}
	public float getProgress() {
		if (duration > 0)
			return Math.min((float) (System.currentTimeMillis() - starttime) / (float) duration, 1);
		return 1;
	}
	public boolean isAlive() {
		if (getProgress() >= 1) {
			return false;
		}
		return true;
	}
	@Override
	public void delete() {
	}
}
